user=${USER}
if [ -n "$1" ] ; then
    user=$1
fi
cmd_prefix="nohup php think queue:work --queue"
#su -s /bin/bash -c "cd /usr/share/nginx/html" ${user}
su -s /bin/bash -c "${cmd_prefix} openprize --daemon > ./runtime/log/openprize.log 2>&1 &" ${user}
su -s /bin/bash -c "${cmd_prefix} autogiveup --daemon > ./runtime/log/autogiveup.log 2>&1 &" ${user}
su -s /bin/bash -c "${cmd_prefix} redpacket --daemon > ./runtime/log/redpacket.log 2>&1 &" ${user}
su -s /bin/bash -c "${cmd_prefix} autoconfirm --daemon > ./runtime/log/autoconfirm.log 2>&1 &" ${user}
su -s /bin/bash -c "${cmd_prefix} invited --daemon > ./runtime/log/invited.log 2>&1 &" ${user}
#su -s /bin/bash -c "php think task start &" ${user}
ps aux | grep queue:work
